import java.awt.Image;
import java.util.ArrayList;

import javax.swing.ImageIcon;

public class Racer extends Component {
	ArrayList<State> moves ;
	ArrayList <Integer> yEpisodes;
	ArrayList <Integer> xAverage;
	double qValues[][][];
	double qHiddenValues[][][];
	double qTargetValues[][][];
	int tableSize;
	State nextState = null;
	State oldState = null;
	TemporalDifference temporal;
	int counter;
	int episode;
	double total;
	double average;
	boolean isFinished;
	double exploration[][][];
	public Racer(int tableSize,int whichRacer){
		moves = new ArrayList<State>();
		average = 0;
		counter = 0;
		total = 0;
		episode = 1;
		yEpisodes = new ArrayList<Integer>();
		xAverage = new ArrayList<Integer>();
		isFinished = false;
		this.tableSize = tableSize;
		this.componentNum = whichRacer +1;
		qHiddenValues = new double[tableSize][tableSize][4];
		qTargetValues = new double[tableSize][tableSize][4];
		exploration = new double[tableSize][tableSize][4];		
		for(int i=0; i<tableSize; i++)
			for(int j=0; j<tableSize; j++)
				for(int k=0; k<4; k++){
					exploration[i][j][k] = 0;
					qHiddenValues[i][j][k] = 0;
					qTargetValues[i][j][k] = 0;
				 
				}
		image =new ImageIcon("picture/racer.png").getImage();
	
	}
	public Image getImage() {
		return image;
	}
}